#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : rascaler
# @Time :  2022/1/18 12:46
from pypinyin import pinyin, Style


class CharacterUtils:
    @staticmethod
    def convertName2Letter(name):
        if name is None:
            return ''
        letters = pinyin(name, style=Style.FIRST_LETTER, strict=False)
        str = ''
        if len(letters) > 0:
            for letter in letters:
                str += letter[0]
        return str.lower()